package base;

public class BoxAuto {
    public static void main(String[] args) {
        // == 时，Integer 自动拆箱，底层数【-128,127】有缓存，在这之外的返回new Integer(i);
        Integer a = 100;
        Integer b = 100;
        Integer c = 128;
        Integer d = 128;
        // true
        System.out.println(a == b);
        // false
        System.out.println(c == d);
        // 直接 new Double(i),没有缓存
        Double e = 10.0;
        Double f = 10.0;
        System.out.println(e == f);
        // 因为true和false都是内部静态变量，所以都一样，为true
        Boolean h = true;
        Boolean k = true;
        System.out.println(h == k);

    }
}
